package com.zhouyu.examplerocketmq.consumer;

import lombok.extern.log4j.Log4j2;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

/**
 * @Description:消费消息时，除了获取消息payload外，还想获取RocketMQ消息的其它系统属性
 */
@Service
@Log4j2
public class MessageConsumer2 implements RocketMQListener<MessageExt> {
    @Override
    public void onMessage(MessageExt messageExt) {
        MessageConsumer2.log.info("获得消息元,MessageExt:{}", messageExt);
    }
}
